package com.example.sqldemo.cursor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Component;

import java.util.ServiceLoader;

@Component
public class TestService {

//    @Autowired
//    private AcutalState state;

    @Autowired
    private SpringUtils springUtils;

    public void m1(){
        State myBean = springUtils.getBean("acutalState");
//        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
//        State myBean = context.getBean("acutalState", State.class);

        myBean.process();
    }
}
